Package com.cisco.pt.ipc.ui
Interface SystemFileManager
- All Superinterfaces:
IPCObject
- All Known Implementing Classes:
SystemFileManagerImpl
Information provided by the PKI file:
\class SystemFileManager
\brief SystemFileManager provides file IO to the local system.
\example systemFileManager()
- Author:
- Auto-generated
-
Method Summary
Modifier and TypeMethodDescriptionInformation provided by the PKI file:Information provided by the PKI file:booleancopySrcDirectoryToDestDirectory(String srcDir, String destDir, boolean bReplace, FilePermissions permissions) Information provided by the PKI file:booleancopySrcFileToDestFile(String srcFile, String destFile) Information provided by the PKI file:Information provided by the PKI file:decryptBinary(String data64, String password) Information provided by the PKI file:booleandecryptFile(String srcFile, String dstFile, String password) Information provided by the PKI file:booleandirectoryExists(String path) Information provided by the PKI file:Information provided by the PKI file:encryptBinary(String data64, String password) Information provided by the PKI file:booleanencryptFile(String srcFile, String dstFile, String password) Information provided by the PKI file:booleanfileExists(String path) Information provided by the PKI file:getAbsolutePath(String path) Information provided by the PKI file:getEncryptedFileBinaryContents(String filename, String password) Information provided by the PKI file:getEncryptedFileContents(String filename, String password) Information provided by the PKI file:getFileBinaryContents(String filename) Information provided by the PKI file:getFileCheckSum(String path) Information provided by the PKI file:getFileContents(String filename) Information provided by the PKI file:longInformation provided by the PKI file:getFilePermissions(String path) Information provided by the PKI file:getFilesInDirectory(String path) Information provided by the PKI file:intgetFileSize(String path) Information provided by the PKI file:Information provided by the PKI file:getOpenFileName(String caption, String path, String filters) Information provided by the PKI file:getOpenFileNames(String caption, String path, String filters) Information provided by the PKI file:getRelativePath(String path1, String path2) Information provided by the PKI file:getSaveFileName(String caption, String path, String filters) Information provided by the PKI file:booleanisAbsolutePath(String path) Information provided by the PKI file:booleanisRelativePath(String path) Information provided by the PKI file:booleanmakeDirectory(String path) Information provided by the PKI file:booleanmoveSrcDirectoryToDestDirectory(String srcDir, String destDir, boolean bReplace) Information provided by the PKI file:booleanmoveSrcFileToDestFile(String srcFile, String destFile, boolean bReplace) Information provided by the PKI file:booleanremoveDirectory(String dirPath) Information provided by the PKI file:booleanremoveFile(String filePath) Information provided by the PKI file:booleansetFilePermissions(String path, FilePermissions permissions) Information provided by the PKI file:booleanInformation provided by the PKI file:booleanunzipFileTo(String filePath, String dstPath) Information provided by the PKI file:booleanunzipFileToWithPassword(String filePath, String dstPath, String password) booleanunzipFileWithPassword(String filePath, String password) booleanwriteBinaryToEncryptedFile(String filename, String contents64, String password) Information provided by the PKI file:booleanwriteBinaryToFile(String filename, String contents64) Information provided by the PKI file:booleanwritePlainTextToFile(String filename, String contents) Information provided by the PKI file:booleanwriteTextToEncryptedFile(String filename, String contents, String password) Information provided by the PKI file:booleanwriteTextToEncryptedLogFile(String filename, String contents) Information provided by the PKI file:booleanwriteTextToFile(String filename, String contents64) Information provided by the PKI file:booleanzipDirectory(String path) Information provided by the PKI file:booleanzipDirectoryTo(String path, String dstFile) Information provided by the PKI file:booleanzipDirectoryToWithPassword(String path, String dstFile, String password) booleanzipDirectoryWithPassword(String path, String password) Methods inherited from interface com.cisco.pt.ipc.IPCObject
getAccessMessage, getClassName, getFactory, getObjectUUID, getPacketTracerSession
-
Method Details
-
getOpenFileName
Information provided by the PKI file:
\brief Prompt the user to select a file to open. It blocks until the user has selected or canceled the dialog. \param caption, the title of the open dialog \param path, the default full path \param filter, the filter of files to show in open dialog in the following format: <filter>[;;<filter[...]]] where each <filter> is in the following format: <name>(*.<extension>[ *.<extension>[...]]) example: "Packet Tracer Activity Sequencer File (*.pks *.pksz);;Zip File (*.zip)" \return QString, the full path of the selected file- Parameters:
caption- Takes in a parameter of captionpath- Takes in a parameter of pathfilters- Takes in a parameter of filters- Returns:
- String Returns a String
-
getOpenFileNames
Information provided by the PKI file:
\brief Prompt the user to select one or multiple files to open. It blocks until the user has selected or canceled the dialog. \param caption, the title of the open dialog \param path, the default full path \param filter, the filter of files to show in open dialog in the following format: <filter>[;;<filter[...]]] where each <filter> is in the following format: <name>(*.<extension>[ *.<extension>[...]]) example: "Packet Tracer Activity Sequencer File (*.pks *.pksz);;Zip File (*.zip)" \return vector<QString>, the full path of the selected files- Parameters:
caption- Takes in a parameter of captionpath- Takes in a parameter of pathfilters- Takes in a parameter of filters- Returns:
- List<String> Returns a List<String>
-
getSaveFileName
Information provided by the PKI file:
\brief Prompt the user to select a file to save. It blocks until the user has selected or canceled the dialog. \param caption, the title of the save dialog \param path, the default full path \param filter, the filter of files to show in save dialog in the following format: <filter>[;;<filter[...]]] where each <filter> is in the following format: <name>(*.<extension>[ *.<extension>[...]]) example: "Packet Tracer Activity Sequencer File (*.pks *.pksz);;Zip File (*.zip)" \return QString, the full path of the selected file- Parameters:
caption- Takes in a parameter of captionpath- Takes in a parameter of pathfilters- Takes in a parameter of filters- Returns:
- String Returns a String
-
getFileContents
Information provided by the PKI file:
\brief Returns the content of a plain text file. \param filename, the full path of the file \return QString, the content of the file- Parameters:
filename- Takes in a parameter of filename- Returns:
- String Returns a String
-
getFileBinaryContents
Information provided by the PKI file:
\brief Returns the content of a binary file in base 64 format. \param filename, the full path of the file \return QString, the content of the file- Parameters:
filename- Takes in a parameter of filename- Returns:
- String Returns a String
-
writeTextToFile
Information provided by the PKI file:
\brief Writes plain text content to a file using UTF-8 encoding. \param filename, the full path of the file. \param contents64, the content in base 64 format \return bool, true if successful, false otherwise- Parameters:
filename- Takes in a parameter of filenamecontents64- Takes in a parameter of contents64- Returns:
- boolean Returns a boolean
-
writePlainTextToFile
Information provided by the PKI file:
\brief Writes plain text content to a file using UTF-8 encoding. \param filename, the full path of the file. \param contents, the contents \return bool, true if successful, false otherwise- Parameters:
filename- Takes in a parameter of filenamecontents- Takes in a parameter of contents- Returns:
- boolean Returns a boolean
-
writeBinaryToFile
Information provided by the PKI file:
\brief Writes binary content to a file. \param filename, the full path of the file. \param contents64, the content in base 64 format \return bool, true if successful, false otherwise- Parameters:
filename- Takes in a parameter of filenamecontents64- Takes in a parameter of contents64- Returns:
- boolean Returns a boolean
-
getFileSize
Information provided by the PKI file:
\brief Returns the size of a file in bytes. \param path, the full path of the file. \return int, size of file in bytes- Parameters:
path- Takes in a parameter of path- Returns:
- int Returns a int
-
getFileCheckSum
Information provided by the PKI file:
\brief Returns the SHA-1 checksum of a file. \param path, the full path of the file. \return QString, the SHA-1 checksum of the file- Parameters:
path- Takes in a parameter of path- Returns:
- String Returns a String
-
getFileModificationTime
Information provided by the PKI file:
\brief Returns the last modification time of a file in number of seconds that have passed since 1970-01-01T00:00:00 UTC. \param path, the full path of the file. \return int, last modification time in number of seconds that have passed since 1970-01-01T00:00:00 UTC.- Parameters:
path- Takes in a parameter of path- Returns:
- long Returns a long
-
getFilePermissions
Information provided by the PKI file:
\brief Returns the permissions of a file. \param path, the full path of the file. \return int, the permissions of the file.- Parameters:
path- Takes in a parameter of path- Returns:
- FilePermissions Returns a FilePermissions
-
setFilePermissions
Information provided by the PKI file:
\brief Sets the permissions of a file. \param path, the full path of the file. \param int, standard Unix permissions format \return bool, true if successful, false otherwise- Parameters:
path- Takes in a parameter of pathpermissions- Takes in a parameter of permissions- Returns:
- boolean Returns a boolean
-
copySrcFileToDestFile
Information provided by the PKI file:
\brief Copies a file. \param srcFile, the full path of the source \param destFile, the full path of the destination \return bool, true if successful, false otherwise- Parameters:
srcFile- Takes in a parameter of srcFiledestFile- Takes in a parameter of destFile- Returns:
- boolean Returns a boolean
-
moveSrcFileToDestFile
Information provided by the PKI file:
\brief Moves or renames a file. \param srcFile, the full path of the source \param destFile, the full path of the destination \param bReplace, true if to replace, false otherwise \return bool, true if successful, false otherwise- Parameters:
srcFile- Takes in a parameter of srcFiledestFile- Takes in a parameter of destFilebReplace- Takes in a parameter of bReplace- Returns:
- boolean Returns a boolean
-
copySrcDirectoryToDestDirectory
boolean copySrcDirectoryToDestDirectory(String srcDir, String destDir, boolean bReplace, FilePermissions permissions) Information provided by the PKI file:
\brief Copies a directory. \param srcDir, the full path of the source \param destDir, the full path of the destination \param bReplace, true if to replace, false otherwise \param permissions, standard Unix permissions format \return bool, true if successful, false otherwise- Parameters:
srcDir- Takes in a parameter of srcDirdestDir- Takes in a parameter of destDirbReplace- Takes in a parameter of bReplacepermissions- Takes in a parameter of permissions- Returns:
- boolean Returns a boolean
-
moveSrcDirectoryToDestDirectory
Information provided by the PKI file:
\brief Moves or renames a directory. \param srcDir, the full path of the source \param destDir, the full path of the destination \param bReplace, true if to replace, false otherwise \return bool, true if successful, false otherwise- Parameters:
srcDir- Takes in a parameter of srcDirdestDir- Takes in a parameter of destDirbReplace- Takes in a parameter of bReplace- Returns:
- boolean Returns a boolean
-
zipDirectory
Information provided by the PKI file:
\brief Zips up a directory into a zip file with the same name. \param path, the full path of the directory \param password, the password to use to encrypt the zip \return bool, true if successful, false otherwise- Parameters:
path- Takes in a parameter of path- Returns:
- boolean Returns a boolean
-
zipDirectoryWithPassword
- Parameters:
path- Takes in a parameter of pathpassword- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
zipDirectoryTo
Information provided by the PKI file:
\brief Zips up a directory into a zip file. \param path, the full path of the directory \param dstFile, the full path of the destination zip file \param password, the password to use to encrypt the zip \return bool, true if successful, false otherwise- Parameters:
path- Takes in a parameter of pathdstFile- Takes in a parameter of dstFile- Returns:
- boolean Returns a boolean
-
zipDirectoryToWithPassword
- Parameters:
path- Takes in a parameter of pathdstFile- Takes in a parameter of dstFilepassword- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
unzipFile
Information provided by the PKI file:
\brief Unzips up a file in the same directory with the same name. \param filePath, the full path of the zip file \param password, the password to use to decrypt the encrypted zip \return bool, true if successful, false otherwise- Parameters:
filePath- Takes in a parameter of filePath- Returns:
- boolean Returns a boolean
-
unzipFileWithPassword
- Parameters:
filePath- Takes in a parameter of filePathpassword- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
unzipFileTo
Information provided by the PKI file:
\brief Unzips up a file in the same directory to a specified directory. \param filePath, the full path of the zip file \param dstPath, the full path of the destination directory \param password, the password to use to decrypt the encrypted zip \return bool, true if successful, false otherwise- Parameters:
filePath- Takes in a parameter of filePathdstPath- Takes in a parameter of dstPath- Returns:
- boolean Returns a boolean
-
unzipFileToWithPassword
- Parameters:
filePath- Takes in a parameter of filePathdstPath- Takes in a parameter of dstPathpassword- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
encrypt
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Encrypts the string using password. Returns empty string if not internal script module or exapps. \param data, the string to be encrypted \param password, the password to use to encrypt \return QString, the encrypted data in base 64 format- Parameters:
data- Takes in a parameter of datapassword- Takes in a parameter of password- Returns:
- String Returns a String
-
decrypt
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Decrypts the data using password. Returns empty string if not internal script module or exapps. \param data, the data to be decrypted in base 64 format \param password, the password to use to decrypt \return QString, the decrypted string- Parameters:
data- Takes in a parameter of datapassword- Takes in a parameter of password- Returns:
- String Returns a String
-
encryptBinary
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Encrypts the binary data using password. Returns empty string if not internal script module or exapps. \param data64, the binary data to be encrypted in base 64 format \param password, the password to use to encrypt \return QString, the encrypted data in base 64 format- Parameters:
data64- Takes in a parameter of data64password- Takes in a parameter of password- Returns:
- String Returns a String
-
decryptBinary
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Decrypts the data using password. Returns empty string if not internal script module or exapps. \param data64, the data to be decrypted in base 64 format \param password, the password to use to decrypt \return QString, the decrypted data in base 64 format- Parameters:
data64- Takes in a parameter of data64password- Takes in a parameter of password- Returns:
- String Returns a String
-
getEncryptedFileContents
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Reads and decrypts the file content using password. Returns empty string if not internal script module or exapps. \param filename, the full path to the file \param password, the password to use to decrypt \return QString, the decrypted string- Parameters:
filename- Takes in a parameter of filenamepassword- Takes in a parameter of password- Returns:
- String Returns a String
-
getEncryptedFileBinaryContents
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Reads and decrypts the binary file content using password. Returns empty string if not internal script module or exapps. \param filename, the full path to the file \param password, the password to use to decrypt \return QString, the decrypted data in base 64 format- Parameters:
filename- Takes in a parameter of filenamepassword- Takes in a parameter of password- Returns:
- String Returns a String
-
writeTextToEncryptedFile
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Encrypts the text content using password and writes to file. Returns false if not internal script module or exapps. \param filename, the full path to the file \param contents, the text content \param password, the password to use to encrypt \return bool, true if successful, false otherwise- Parameters:
filename- Takes in a parameter of filenamecontents- Takes in a parameter of contentspassword- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
writeBinaryToEncryptedFile
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Encrypts the binary content using password and writes to file. Returns false if not internal script module or exapps. \param filename, the full path to the file \param contents64, the data in base 64 format \param password, the password to use to encrypt \return bool, true if successful, false otherwise- Parameters:
filename- Takes in a parameter of filenamecontents64- Takes in a parameter of contents64password- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
writeTextToEncryptedLogFile
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Encrypts the text content using same method as PT log file format and writes to file. Returns false if not internal script module or exapps. \param filename, the full path to the file \param contents, the text content \return bool, true if successful, false otherwise- Parameters:
filename- Takes in a parameter of filenamecontents- Takes in a parameter of contents- Returns:
- boolean Returns a boolean
-
encryptFile
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Encrypts a file using password and writes to another file. Returns false if not internal script module or exapps. \param srcFile, the full path to the source file \param dstFile, the full path of the destination file \param password, the password to use to encrypt \return bool, true if successful, false otherwise- Parameters:
srcFile- Takes in a parameter of srcFiledstFile- Takes in a parameter of dstFilepassword- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
decryptFile
Information provided by the PKI file:
\brief FOR INTERNAL USE ONLY. Decrypts a file using password and writes to another file. Returns false if not internal script module or exapps. \param srcFile, the full path to the source file \param dstFile, the full path of the destination file \param password, the password to use to decrypt \return bool, true if successful, false otherwise- Parameters:
srcFile- Takes in a parameter of srcFiledstFile- Takes in a parameter of dstFilepassword- Takes in a parameter of password- Returns:
- boolean Returns a boolean
-
makeDirectory
Information provided by the PKI file:
\brief Creates a directory including all missing parents. \param path, the full path of the directory \return bool, true if successful, false otherwise- Parameters:
path- Takes in a parameter of path- Returns:
- boolean Returns a boolean
-
removeFile
Information provided by the PKI file:
\brief Removes a file. \param path, the full path of the file \return bool, true if successful, false otherwise- Parameters:
filePath- Takes in a parameter of filePath- Returns:
- boolean Returns a boolean
-
removeDirectory
Information provided by the PKI file:
\brief Removes a directory recursively including all sub directories and files. \param path, the full path of the directory \return bool, true if successful, false otherwise- Parameters:
dirPath- Takes in a parameter of dirPath- Returns:
- boolean Returns a boolean
-
directoryExists
Information provided by the PKI file:
\brief Returns whether a directory exists. \param path, the full path of the directory \return bool, true if it exists and is a directory, false otherwise- Parameters:
path- Takes in a parameter of path- Returns:
- boolean Returns a boolean
-
fileExists
Information provided by the PKI file:
\brief Returns whether a file exists. \param path, the full path of the file \return bool, true if it exists and is a file, false otherwise- Parameters:
path- Takes in a parameter of path- Returns:
- boolean Returns a boolean
-
convertToNativeSeparators
Information provided by the PKI file:
\brief Converts a path to native format with native separators. \param path, a path name \return QString, the path converted to native format- Parameters:
path- Takes in a parameter of path- Returns:
- String Returns a String
-
convertFromNativeSeparators
Information provided by the PKI file:
\brief Converts a path to Unix format with Unix separators. \param path, a path name \return QString, the path converted to Unix format- Parameters:
path- Takes in a parameter of path- Returns:
- String Returns a String
-
isAbsolutePath
Information provided by the PKI file:
\brief Returns whether the path is absolute. \param path, a path name \return bool, whether the path is absolute.- Parameters:
path- Takes in a parameter of path- Returns:
- boolean Returns a boolean
-
isRelativePath
Information provided by the PKI file:
\brief Returns whether the path is relative. \param path, a path name \return bool, whether the path is relative.- Parameters:
path- Takes in a parameter of path- Returns:
- boolean Returns a boolean
-
getRelativePath
Information provided by the PKI file:
\brief Returns path name of path2 relative to path1. \param path1, the full base path name \param path2, the full sub path name \return QString, the path name of path2 relative to path1.- Parameters:
path1- Takes in a parameter of path1path2- Takes in a parameter of path2- Returns:
- String Returns a String
-
getAbsolutePath
Information provided by the PKI file:
\brief Returns absolute path name. \param path, a path anme \return QString, absolute path name.- Parameters:
path- Takes in a parameter of path- Returns:
- String Returns a String
-
getFilesInDirectory
Information provided by the PKI file:
\brief Returns a list of files and directory names in a directory. \param path, the full path of the directory \return vector<QString>, the list of files and directory names- Parameters:
path- Takes in a parameter of path- Returns:
- List<String> Returns a List<String>
-
getFileWatcher
SystemFileWatcher getFileWatcher()Information provided by the PKI file:
\brief Returns the SystemFileWatcher instance for this Script Module. This is not available for ExApps and will return NULL. \return SystemFileWatcher, the instance for this Script Module- Returns:
- SystemFileWatcher Returns a SystemFileWatcher
-